﻿#Include ..\baseHandle.ahk

#Include ..\..\_lib\WtRunner.ahk

class Scp extends BaseHandle {

  static Handle(parsed) {
    WtRunner.Builder()
      .NewTab('scp', , ,
        , "'" parsed.target ' -> ~/scp' GetV('/original') "'"
        . '&& '
        . 'scp ' parsed.target ' xcatp@120.76.242.234:~/scp' GetV(''))
      .Build()
      .RunCmd()
    return this.Succ('ok', 'x')

    GetV(d) => parsed.Extra.Length ? '/' parsed.Extra[1] : d
  }

  static Echo() => '
    (
      scp 上传文件到服务器
      scp <target> [name]
    )'

}
